<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header','admin');?>
<div id="closeParentTime" style="display:none"></div>
<script type="text/javascript">
	window.top.$('#display_center_id').css('display','none');
</script>
<script>
    function change_color_over(title_id){
    	$("#"+title_id).css('color',"blue");
    }
    function change_color_out(title_id){
    	$("#"+title_id).css('color',"black");
    }
</script>
<div class="pad-10">
<div id="searchid" style="">
<form name="searchform" action="" method="get" >
<input type="hidden" value="<?php echo ROUTE_M;?>" name="m">
<input type="hidden" value="<?php echo ROUTE_C;?>" name="c">
<input type="hidden" value="<?php echo ROUTE_A;?>" name="a">
<input type='hidden' name = 'status' value='<?php if($status=='unchecked'){echo 'unchecked';}else{echo '';}?>'>
<input type="hidden" value="1" name="search">
<input type="hidden" value="<?=$num?>" name="num">
<input type="hidden" value="<?php echo $pc_hash;?>" name="pc_hash">
<table width="100%" cellspacing="0" class="search-form">
    <tbody>
		<tr>
		<td>
		<div class="explain-col">
 
				<?php echo L('publish_time');?>：
				<?php echo form::date('start_time',$_GET['start_time'],0,0,'false');?>- &nbsp;<?php echo form::date('end_time',$_GET['end_time'],0,0,'false');?>
				<?php echo L('type')?>：
				<select name="catid" >
				<option value="0">请选择</option>
				<?php echo $select_categorys;?>
				</select>
				<!--<?php echo L('contestName')?>：
				<select name="contest_id" >
				<option value="0">请选择</option>
				<?php echo $categorys;?>
				</select>-->
				
				<?php echo L('title');?>：<input name="title" type="text" value="<?php echo $_GET['title']?>" class="input-text" />
				<input type="submit" name="search" class="button" value="<?php echo L('search');?>" />
				
	</div>
	<!-- <div class="explain-col" style="margin-top:5px;">
		绑定栏目：<?php echo form::select_category('category_content_'.$this->siteid,'','name="cate_id" id="cate_id"','请选择',0,-1);?>
				<a href="javascript:;" class="button" onclick="ajaxRelease(1);">发布</a>
	</div> -->
		</td>
		</tr>
    </tbody>
</table>
</form>
</div>
<form name="myform" id="myform" action="" method="post" >
<div class="table-list">
    <table width="100%">
        <thead>
            <tr>
			<th width="16" align='center'><input type="checkbox" value="" id="check_box" onclick="selectall('ids[]');"></th>
            <th width="40" align='center'><?php echo L('listorder');?></th>
            <th width="40" align='center'>ID</th>
			<th align='center' width="120"><?php echo L('title');?></th>
			<th width="100" align='center'><?php echo L('information_image_cover');?></th><?php if($status=='unchecked'){?>
            <th width="100" align='center'><?php echo L('source_name');?></th><?php }?>
            <th width="100" align='center'><?php echo L('type');?></th>
            <!-- <th width="100" align='center'><?php echo L('contestName');?></th> -->
            <th width="120" align='center'><?php echo L('create_time');?></th>
            <th align='center' width="70"><?php echo L('create_name')?></th>
			<th width="150" align='center'><?php echo L('operations_manage');?></th>
            </tr>
        </thead>
<tbody>
    <?php
	if(!empty($information_list)) {
		
		foreach ($information_list as $r) {
	?>
        <tr>
		<td align="center"><input class="inputcheckbox " name="ids[]" value="<?php echo $r['id'];?>" type="checkbox"></td>
        <td align='center'><input name='listorders[<?php echo $r['id'];?>]' type='text' size='3' value='<?php echo $r['sort'];?>' class='input-text-c'></td>
		<td align='center' ><?php echo $r['id'];?></td>
		<td align='center'><a href="http://m.nsr.com.cn/xinsilu/v1/webPage/showNewsNsrHtml/<?=$r['id']?>?from=timeline"  id="title_<?php echo $r['id'];?>" target="_blank"  onmouseover="change_color_over('title_'+<?php echo $r['id'];?>)" onmouseout="change_color_out('title_'+<?php echo $r['id'];?>)" title="点击可预览：<?php echo $r['title'];?>资讯"><?php echo str_cut($r['title'],132);?></a></td>
		<td align='center'><?php if ($r['image_cover']){ ?><img src="<?php echo $r['image_cover'];?>" width="80"/><?php }else{echo '<font color="red">（未设置）</font>';}?></td>
		<?php if($status=='unchecked'){?>
		<td align='center'><?php echo $r['source_name']?$r['source_name']:'<font color="red">（未设置）</font>';?></td><?php }?>
		<td align='center'><?php echo $r['typeName']?$r['typeName']:'<font color="red">（未设置）</font>';?></td>
		<!-- <td align='center'><?php echo $r['contestName']?$r['contestName']:'<font color="red">（未设置）</font>';?></td> -->
		<td align='center'><?php echo $r['create_time'];?></td>
		<td align="center"><?php echo $adminInfo[$r['updated_by']];?></td>
		<td align='center'>
		<a href="?m=information&c=information&a=edit&id=<?php echo $r['id']?>&status=<?php if($status=='unchecked'){echo 'unchecked';}else{echo '';}?>"><?php echo L('edit')?></a> | 
		<a href="?m=information&c=information&a=delete&id=<?php echo $r['id']?>&title=<?php echo $r['title'];?>" onClick="return confirm('<?php echo L('confirm', array('message' => new_addslashes($r['title'])))?>')"><?php echo L('delete')?></a>
		<?php if($status!='unchecked'){?><!--<a href="?m=information&c=information&a=show&id=<?php echo $r['id']?>&source_type=1"><?php echo L('show')?></a>--><?php }else{?> | <a href="?m=information&c=information&a=check_in&id=<?php echo $r['id']?>&source_type=1&title=<?php echo $r['title'];?>"><?php echo L('check_in')?></a><?php }?></td>
	</tr>
     <?php }
	} else {
		echo "<tr><td colspan='10' style='color:red;font-size:18px;text-align:center;'><span>暂无数据！</span></td></tr>";
	}
	?>
</tbody>
     </table>
    <div class="btn"><label for="check_box"><?php echo L('selected_all');?>/<?php echo L('cancel');?></label>
		<input type="hidden" value="<?php echo $pc_hash;?>" name="pc_hash">
    	<input type="button" class="button" value="<?php echo L('listorder');?>" onclick="myform.action='?m=information&c=information&a=listorder&dosubmit=1&steps=<?php echo $steps;?>';myform.submit();"/>
		<input type="button" class="button" value="<?php echo L('delete');?>" onclick="myform.action='?m=information&c=information&a=deleteAll&dosubmit=1&steps=<?php echo $steps;?>';return confirm_delete()"/>
		每页条数：
		<select onchange="window.location='?m=<?php echo ROUTE_M;?>&c=<?php echo ROUTE_C;?>&a=<?php echo ROUTE_A;?>&status=<?php  if($status=='unchecked'){echo 'unchecked';}else{echo '';}?>&pc_hash=<?php echo $_SESSION['pc_hash'];?>&num='+this.value">
			<option value="10" <?php if($num == 10){?>selected<?php }?> >10</option>
			<option value="15" <?php if($num == 15){?>selected<?php }?> >15</option>
			<option value="20" <?php if($num == 20){?>selected<?php }?> >20</option>
			<option value="30" <?php if($num == 30){?>selected<?php }?> >30</option>
			<option value="50" <?php if($num == 50){?>selected<?php }?> >50</option>
		</select>
	</div>
    <div id="pages"><?php echo $pages;?></div>
</div>
</form>
</div>
<script language="javascript" type="text/javascript" src="<?php echo JS_PATH?>cookie.js"></script>
<script type="text/javascript"> 
<!--
function push() {
	var str = 0;
	var id = tag = '';
	$("input[name='ids[]']").each(function() {
		if($(this).attr('checked')=='checked') {
			str = 1;
			id += tag+$(this).val();
			tag = '|';
		}
	});
	if(str==0) {
		alert('<?php echo L('you_do_not_check');?>');
		return false;
	}
	window.top.art.dialog({id:'push'}).close();
	window.top.art.dialog({title:'<?php echo L('push');?>：',id:'push',iframe:'?m=content&c=push&action=position_list&catid=<?php echo $catid?>&modelid=<?php echo $modelid?>&id='+id,width:'800',height:'500'}, function(){var d = window.top.art.dialog({id:'push'}).data.iframe;// 使用内置接口获取iframe对象
	var form = d.document.getElementById('dosubmit');form.click();return false;}, function(){window.top.art.dialog({id:'push'}).close()});
}
function confirm_delete(){
	if(confirm('<?php echo L('confirm_delete', array('message' => L('selected')));?>')) $('#myform').submit();
}
function view_comment(id, name) {
	window.top.art.dialog({id:'view_comment'}).close();
	window.top.art.dialog({yesText:'<?php echo L('dialog_close');?>',title:'<?php echo L('view_comment');?>：'+name,id:'view_comment',iframe:'index.php?m=comment&c=comment_admin&a=lists&show_center_id=1&commentid='+id,width:'800',height:'500'}, function(){window.top.art.dialog({id:'edit'}).close()});
}
function reject_check(type) {
	if(type==1) {
		var str = 0;
		$("input[name='ids[]']").each(function() {
			if($(this).attr('checked')=='checked') {
				str = 1;
			}
		});
		if(str==0) {
			alert('<?php echo L('you_do_not_check');?>');
			return false;
		}
		document.getElementById('myform').action='?m=content&c=content&a=pass&catid=<?php echo $catid;?>&steps=<?php echo $steps;?>&reject=1';
		document.getElementById('myform').submit();
	} else {
		$('#reject_content').css('display','');
		return false;
	}	
}
setcookie('refersh_time', 0);
function refersh_window() {
	var refersh_time = getcookie('refersh_time');
	if(refersh_time==1) {
		window.location.reload();
	}
}
setInterval("refersh_window()", 3000);
//-->
</script>
</body>
</html>